package com.lwz.laboratory.service;

import com.lwz.laboratory.dao.DepartmentMapper;
import com.lwz.laboratory.dao.LaboratoryMapper;
import com.lwz.laboratory.entity.Department;
import com.lwz.laboratory.entity.Laboratory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LaboratoryService {

    @Autowired
    private LaboratoryMapper laboratoryMapper;

    public List<Laboratory> getAlllab(String labname){
        return laboratoryMapper.getLabList(labname);

    }
    public List<Laboratory> getAlllabbyth(String technician){
        return laboratoryMapper.getLabListbyth(technician);

    }

    public Laboratory getonelab(Integer id){
        return laboratoryMapper.selectByPrimaryKey(id);

    }

    public void Addlab(Laboratory laboratory){
        laboratoryMapper.insertSelective(laboratory);

    }

    public void Updatelab(Laboratory laboratory){
        laboratoryMapper.updateByPrimaryKeySelective(laboratory);

    }

    public void Dellab(Integer id){
        laboratoryMapper.deleteByPrimaryKey(id);

    }
}
